package ${controllerPackage};

import ${entityPackage}.${entity}Entity;
import ${servicePackage}.${entity}Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * 描述: ${table.comment}
 * author: ${author}
 * date: ${date}
 */
@RestController
@RequestMapping(value="/${entity?uncap_first}")
public class ${entity}Controller {

    @Autowired
    private ${entity}Service ${entity?uncap_first}Service;

    @RequestMapping("/insert")
    public Integer insert(${entity}Entity entity){
        return ${entity?uncap_first}Service.insert(entity);
    }

    @RequestMapping("/delete")
    public Integer delete(int id){
        return ${entity?uncap_first}Service.delete(id);
    }

    @RequestMapping("/update")
    public Integer update(${entity}Entity entity){
        return ${entity?uncap_first}Service.update(entity);
    }

    @RequestMapping("/select")
    public List<${entity}Entity> select(${entity}Entity entity){
        return ${entity?uncap_first}Service.select(entity);
    }

    @RequestMapping("/selectById")
    public ${entity}Entity selectById(int id) {
        return ${entity?uncap_first}Service.selectById(id);
    }



}
